<template>
  <div class="modal_onfirm">
    <Modal v-model="modal" width="300" :closable='false'>
      <template #header>
        <p style="text-align:center;font-weight:600;line-height: 1.5">
          <span>{{info.title}}</span>
        </p>
      </template>
      <div style="text-align:center">
        <p>{{info.content}}</p>
      </div>
      <template #footer>
        <div style="display: flex;justify-content: space-around;">
          <Button type="text" @click="ok"
            style="width:50%;border-right:1px">{{info.btnTxt}}</Button>
          <Button type="text" @click="cancel" style="width:50%">取消</Button>
        </div>
      </template>
    </Modal>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        modal: false,
        info: {}
      }
    },
    methods: {
      show(data) {
        this.modal = true
        this.info = data
      },
      ok() {
        this.$emit('success', this.info)
        this.cancel()
      },
      cancel() {
        this.modal = false
      },
    },
  }
</script>
<style lang='scss' scoped>
  .modal_onfirm {
    ::v-deep .ivu-modal-footer {
      padding: 0;
    }
  }
</style>